package com.xingkeduo.util.tool;

import com.alibaba.fastjson.JSON;

import java.util.List;

/**
 * @Description TODO
 * @Date 2019/4/28 19:48
 * @Created 情绪十分不稳定的Shadow
 */
public class DatatablesPage<T> {

    private List<T> aaData; //aaData 与datatales 加载的“dataSrc"对应
    private long iTotalDisplayRecords;
    private long iTotalRecords;
    /**
     *
     * @param iTotalRecords 总条数
     * @param iTotalDisplayRecords 查询出的条数 未查询时候和总数相等
     * @param aaData 返回的数据列表
     */
    public DatatablesPage() {
    }
    public DatatablesPage(long iTotalRecords, long iTotalDisplayRecords, List<T> aaData  ) {
        this.iTotalRecords = iTotalRecords;
        this.iTotalDisplayRecords = iTotalDisplayRecords;
        this.aaData = aaData;
    }
    public List<T> getAaData() {
        return aaData;
    }
    public void setAaData(List<T> aaData) {
        this.aaData = aaData;
    }
    public long getiTotalDisplayRecords() {
        return iTotalDisplayRecords;
    }
    public void setiTotalDisplayRecords(long iTotalDisplayRecords) {
        this.iTotalDisplayRecords = iTotalDisplayRecords;
    }
    public long getiTotalRecords() {
        return iTotalRecords;
    }
    public void setiTotalRecords(long iTotalRecords) {
        this.iTotalRecords = iTotalRecords;
    }

    @Override
    public String toString() {
        return JSON.toJSONStringWithDateFormat(this, "yyyy-MM-dd HH:mm:ss");
    }

}
